/********************************************************************
 * create by yang.zheng on 2020-07-28 for 文件入口
 *******************************************************************/

 //引入express
 const express = require('express')

 //引入日志打印
 const {logs} = require('./utils')

 //引入配置文件
 const {SERVER_PORT} = require('./config')

 //实例化
 const app = express()

 //添加中间件
 app.use(express.json())
 app.use(express.urlencoded('extends:false'))

 //添加静态
const path = require('path')
app.use(express.static(path.join(__dirname,'public'),{index:'login.html'}))

 //监听接口
 app.listen(9420,() => {
     logs('servers started on port:9420')
 })

 //引入路由
 const Router = require('./router')
 Router(app)